<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
    <title>Reference</title>
    <link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<br/>
<h1>Duplex</h1>

<ul>
  <li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>


<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
  <li><a href="../modules/Duplex.Application.html">Duplex.Application</a></li>
  <li><a href="../modules/Duplex.Applications.Effect.html">Duplex.Applications.Effect</a></li>
  <li><a href="../modules/Duplex.Applications.GridPie.html">Duplex.Applications.GridPie</a></li>
  <li><a href="../modules/Duplex.Applications.Hydra.html">Duplex.Applications.Hydra</a></li>
  <li><a href="../modules/Duplex.Applications.Instrument.html">Duplex.Applications.Instrument</a></li>
  <li><a href="../modules/Duplex.Applications.Keyboard.GridLayout.html">Duplex.Applications.Keyboard.GridLayout</a></li>
  <li><a href="../modules/Duplex.Applications.Keyboard.Layouts.HarmonicLayout.html">Duplex.Applications.Keyboard.Layouts.HarmonicLayout</a></li>
  <li><a href="../modules/Duplex.Applications.Keyboard.Layouts.IsomorphicLayout.html">Duplex.Applications.Keyboard.Layouts.IsomorphicLayout</a></li>
  <li><a href="../modules/Duplex.Applications.Keyboard.Layouts.PianoLayout.html">Duplex.Applications.Keyboard.Layouts.PianoLayout</a></li>
  <li><a href="../modules/Duplex.Applications.Keyboard.html">Duplex.Applications.Keyboard</a></li>
  <li><a href="../modules/Duplex.Applications.Matrix.html">Duplex.Applications.Matrix</a></li>
  <li><a href="../modules/Duplex.Applications.Metronome.html">Duplex.Applications.Metronome</a></li>
  <li><a href="../modules/Duplex.Applications.MidiActions.Bindings.html">Duplex.Applications.MidiActions.Bindings</a></li>
  <li><a href="../modules/Duplex.Applications.MidiActions.html">Duplex.Applications.MidiActions</a></li>
  <li><a href="../modules/Duplex.Applications.Mixer.html">Duplex.Applications.Mixer</a></li>
  <li><a href="../modules/Duplex.Applications.Mlrx.Mlrx_group.html">Duplex.Applications.Mlrx.Mlrx_group</a></li>
  <li><a href="../modules/Duplex.Applications.Mlrx.Mlrx_note.html">Duplex.Applications.Mlrx.Mlrx_note</a></li>
  <li><a href="../modules/Duplex.Applications.Mlrx.Mlrx_pos.html">Duplex.Applications.Mlrx.Mlrx_pos</a></li>
  <li><a href="../modules/Duplex.Applications.Mlrx.Mlrx_track.html">Duplex.Applications.Mlrx.Mlrx_track</a></li>
  <li><a href="../modules/Duplex.Applications.Mlrx.html">Duplex.Applications.Mlrx</a></li>
  <li><a href="../modules/Duplex.Applications.Navigator.html">Duplex.Applications.Navigator</a></li>
  <li><a href="../modules/Duplex.Applications.NotesOnWheels.html">Duplex.Applications.NotesOnWheels</a></li>
  <li><a href="../modules/Duplex.Applications.PatternCursor.html">Duplex.Applications.PatternCursor</a></li>
  <li><a href="../modules/Duplex.Applications.PatternSequence.html">Duplex.Applications.PatternSequence</a></li>
  <li><a href="../modules/Duplex.Applications.Recorder.html">Duplex.Applications.Recorder</a></li>
  <li><a href="../modules/Duplex.Applications.Repeater.html">Duplex.Applications.Repeater</a></li>
  <li><a href="../modules/Duplex.Applications.Rotate.html">Duplex.Applications.Rotate</a></li>
  <li><a href="../modules/Duplex.Applications.StepSequencer.html">Duplex.Applications.StepSequencer</a></li>
  <li><a href="../modules/Duplex.Applications.SwitchConfiguration.html">Duplex.Applications.SwitchConfiguration</a></li>
  <li><a href="../modules/Duplex.Applications.TestPad.html">Duplex.Applications.TestPad</a></li>
  <li><a href="../modules/Duplex.Applications.TrackSelector.html">Duplex.Applications.TrackSelector</a></li>
  <li><a href="../modules/Duplex.Applications.Transport.html">Duplex.Applications.Transport</a></li>
  <li><a href="../modules/Duplex.Applications.UIButtonTest.html">Duplex.Applications.UIButtonTest</a></li>
  <li><a href="../modules/Duplex.Applications.XYPad.html">Duplex.Applications.XYPad</a></li>
  <li><a href="../modules/Duplex.Automation.html">Duplex.Automation</a></li>
  <li><a href="../modules/Duplex.Browser.html">Duplex.Browser</a></li>
  <li><a href="../modules/Duplex.BrowserProcess.html">Duplex.BrowserProcess</a></li>
  <li><a href="../modules/Duplex.Canvas.html">Duplex.Canvas</a></li>
  <li><a href="../modules/Duplex.CanvasPoint.html">Duplex.CanvasPoint</a></li>
  <li><a href="../modules/Duplex.ControlMap.html">Duplex.ControlMap</a></li>
  <li><a href="../modules/Duplex.Device.html">Duplex.Device</a></li>
  <li><a href="../modules/Duplex.Display.html">Duplex.Display</a></li>
  <li><a href="../modules/Duplex.Globals.html">Duplex.Globals</a></li>
  <li><a href="../modules/Duplex.Message.html">Duplex.Message</a></li>
  <li><a href="../modules/Duplex.MessageStream.html">Duplex.MessageStream</a></li>
  <li><a href="../modules/Duplex.MidiDevice.html">Duplex.MidiDevice</a></li>
  <li><a href="../modules/Duplex.OscClient.html">Duplex.OscClient</a></li>
  <li><a href="../modules/Duplex.OscDevice.html">Duplex.OscDevice</a></li>
  <li><a href="../modules/Duplex.OscVoiceMgr.html">Duplex.OscVoiceMgr</a></li>
  <li><a href="../modules/Duplex.Preferences.html">Duplex.Preferences</a></li>
  <li><a href="../modules/Duplex.ProcessSlicer.html">Duplex.ProcessSlicer</a></li>
  <li><a href="../modules/Duplex.RoamingDSP.html">Duplex.RoamingDSP</a></li>
  <li><a href="../modules/Duplex.Scheduler.html">Duplex.Scheduler</a></li>
  <li><a href="../modules/Duplex.StateController.html">Duplex.StateController</a></li>
  <li><a href="../modules/Duplex.UIButton.html">Duplex.UIButton</a></li>
  <li><a href="../modules/Duplex.UIButtonStrip.html">Duplex.UIButtonStrip</a></li>
  <li><a href="../modules/Duplex.UIComponent.html">Duplex.UIComponent</a></li>
  <li><a href="../modules/Duplex.UIKey.html">Duplex.UIKey</a></li>
  <li><a href="../modules/Duplex.UIKeyPressure.html">Duplex.UIKeyPressure</a></li>
  <li><a href="../modules/Duplex.UILabel.html">Duplex.UILabel</a></li>
  <li><a href="../modules/Duplex.UIPad.html">Duplex.UIPad</a></li>
  <li><a href="../modules/Duplex.UIPitchBend.html">Duplex.UIPitchBend</a></li>
  <li><a href="../modules/Duplex.UISlider.html">Duplex.UISlider</a></li>
  <li><a href="../modules/Duplex.UISpinner.html">Duplex.UISpinner</a></li>
  <li><a href="../modules/Duplex.WidgetHooks.html">Duplex.WidgetHooks</a></li>
  <li><strong>Duplex.WidgetKeyboard</strong></li>
  <li><a href="../modules/Duplex.html">Duplex</a></li>
  <li><a href="../modules/main.html">main</a></li>
</ul>

</div>

<div id="content">

<h1>Module <code>Duplex.WidgetKeyboard</code></h1>
<p>

</p>
<p>A custom widget for visualizing an on-screen keyboard </p>


<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#update_all_keys">update_all_keys ()</a></td>
	<td class="summary">iterate through and update all visible keys</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#update_key">update_key (pitch)</a></td>
	<td class="summary">update a given key's visual appearance
 state is stored in keystates, also when not currently visible</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#index_to_midi_msg">index_to_midi_msg (key_idx, release)</a></td>
	<td class="summary">generate output based on the pressed key</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#index_to_note">index_to_note (key_idx)</a></td>
	<td class="summary">convert a given index to midi note (on/off)</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#note_to_index">note_to_index (pitch)</a></td>
	<td class="summary">convert a pitch to an index</td>
	</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#self.pressed_keys">self.pressed_keys</a></td>
	<td class="summary">(table) list of pressed keys</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#self.disabled_keys">self.disabled_keys</a></td>
	<td class="summary">(table) list of disabled keys</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#self.keystates">self.keystates</a></td>
	<td class="summary">(table) visual state for each key, indexed by pitch
 if not specified, defaults to KEYS<em>COLOR</em>WHITE etc.</td>
	</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#self.voicemgr">self.voicemgr</a></td>
	<td class="summary">(OscVoiceMgr) this is where we get our active voices from</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#self.param">self.param</a></td>
	<td class="summary">(table) the control-map parameter that define this widget</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#self.display">self.display</a></td>
	<td class="summary">(Display) where we direct our messages</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#self.id">self.id</a></td>
	<td class="summary">viewbuilder id</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#self.oct_dn">self.oct_dn</a></td>
	<td class="summary">transpose down</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#self.oct_up">self.oct_up</a></td>
	<td class="summary">transpose up</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#self.range">self.range</a></td>
	<td class="summary">(int) number of keys</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#self.show_octave">self.show_octave</a></td>
	<td class="summary">(bool) add octave buttons on either side</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#self.upper_note">self.upper_note</a></td>
	<td class="summary">(int) upper boundary</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#self.lower_note">self.lower_note</a></td>
	<td class="summary">(int) lower boundary</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#self.octave">self.octave</a></td>
	<td class="summary">(int) current octave (as seen in the left side)</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#self.width">self.width</a></td>
	<td class="summary">(number) relative width</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#self.height">self.height</a></td>
	<td class="summary">(number) relative height</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#self.tooltip">self.tooltip</a></td>
	<td class="summary">(string)</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#self.channel">self.channel</a></td>
	<td class="summary">(int) the channel used when generating output</td>
	</tr>
</table>

<br/>
<br/>


    <h2><a name="Functions"></a>Functions</h2>
    <dl class="function">
    <dt>
    <a name = "update_all_keys"></a>
    <strong>update_all_keys ()</strong>
    </dt>
    <dd>
    iterate through and update all visible keys







</dd>
    <dt>
    <a name = "update_key"></a>
    <strong>update_key (pitch)</strong>
    </dt>
    <dd>
    update a given key's visual appearance
 state is stored in keystates, also when not currently visible


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">pitch</span>
         (int) the key we wish to update
        </li>
    </ul>





</dd>
    <dt>
    <a name = "index_to_midi_msg"></a>
    <strong>index_to_midi_msg (key_idx, release)</strong>
    </dt>
    <dd>
    generate output based on the pressed key


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">key_idx</span>



        </li>
        <li><span class="parameter">release</span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "index_to_note"></a>
    <strong>index_to_note (key_idx)</strong>
    </dt>
    <dd>
    convert a given index to midi note (on/off)


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">key_idx</span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "note_to_index"></a>
    <strong>note_to_index (pitch)</strong>
    </dt>
    <dd>
    convert a pitch to an index


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">pitch</span>



        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

        int when pitch is within view, nil when not
    </ol>




</dd>
</dl>
    <h2><a name="Tables"></a>Tables</h2>
    <dl class="function">
    <dt>
    <a name = "self.pressed_keys"></a>
    <strong>self.pressed_keys</strong>
    </dt>
    <dd>
    (table) list of pressed keys







</dd>
    <dt>
    <a name = "self.disabled_keys"></a>
    <strong>self.disabled_keys</strong>
    </dt>
    <dd>
    (table) list of disabled keys







</dd>
    <dt>
    <a name = "self.keystates"></a>
    <strong>self.keystates</strong>
    </dt>
    <dd>
    (table) visual state for each key, indexed by pitch
 if not specified, defaults to KEYS<em>COLOR</em>WHITE etc.
 {
  white           = {r,g,b},
  white<em>pressed   = {r,g,b},
  white</em>disabled  = {r,g,b},
  black           = {r,g,b},
  black<em>pressed   = {r,g,b},
  black</em>disabled  = {r,g,b},
 }







</dd>
</dl>
    <h2><a name="Fields"></a>Fields</h2>
    <dl class="function">
    <dt>
    <a name = "self.voicemgr"></a>
    <strong>self.voicemgr</strong>
    </dt>
    <dd>
    (OscVoiceMgr) this is where we get our active voices from







</dd>
    <dt>
    <a name = "self.param"></a>
    <strong>self.param</strong>
    </dt>
    <dd>
    (table) the control-map parameter that define this widget







</dd>
    <dt>
    <a name = "self.display"></a>
    <strong>self.display</strong>
    </dt>
    <dd>
    (Display) where we direct our messages







</dd>
    <dt>
    <a name = "self.id"></a>
    <strong>self.id</strong>
    </dt>
    <dd>
    viewbuilder id







</dd>
    <dt>
    <a name = "self.oct_dn"></a>
    <strong>self.oct_dn</strong>
    </dt>
    <dd>
    transpose down







</dd>
    <dt>
    <a name = "self.oct_up"></a>
    <strong>self.oct_up</strong>
    </dt>
    <dd>
    transpose up







</dd>
    <dt>
    <a name = "self.range"></a>
    <strong>self.range</strong>
    </dt>
    <dd>
    (int) number of keys







</dd>
    <dt>
    <a name = "self.show_octave"></a>
    <strong>self.show_octave</strong>
    </dt>
    <dd>
    (bool) add octave buttons on either side







</dd>
    <dt>
    <a name = "self.upper_note"></a>
    <strong>self.upper_note</strong>
    </dt>
    <dd>
    (int) upper boundary







</dd>
    <dt>
    <a name = "self.lower_note"></a>
    <strong>self.lower_note</strong>
    </dt>
    <dd>
    (int) lower boundary







</dd>
    <dt>
    <a name = "self.octave"></a>
    <strong>self.octave</strong>
    </dt>
    <dd>
    (int) current octave (as seen in the left side)







</dd>
    <dt>
    <a name = "self.width"></a>
    <strong>self.width</strong>
    </dt>
    <dd>
    (number) relative width







</dd>
    <dt>
    <a name = "self.height"></a>
    <strong>self.height</strong>
    </dt>
    <dd>
    (number) relative height







</dd>
    <dt>
    <a name = "self.tooltip"></a>
    <strong>self.tooltip</strong>
    </dt>
    <dd>
    (string)







</dd>
    <dt>
    <a name = "self.channel"></a>
    <strong>self.channel</strong>
    </dt>
    <dd>
    (int) the channel used when generating output







</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>
